<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改兽药库存')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-ncDrugsLog-add" th:object="${ncDrugs}">
        <input id="drugId" name="drugId" th:field="*{drugId}" type="hidden">
        <div class="form-group" hidden="hidden">
            <label class="col-sm-3 control-label">兽药id：</label>
            <div class="col-sm-8">
                <input class="form-control" id="drugCode" name="drugCode" th:field="*{drugCode}" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">出库时间：</label>
            <div class="col-sm-8">
                <input class="form-control" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" id="createTime" name="createTime"
                       required th:class="time-input" th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd HH:mm:ss')}" type="text">
            </div>
        </div>
        <div class="form-group" hidden="hidden">
            <label class="col-sm-3 control-label">兽药名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="drugName" name="drugName" th:field="*{drugName}" type="text">
            </div>
        </div>
        <div class="form-group" hidden="hidden">
            <label class="col-sm-3 control-label">生产厂家：</label>
            <div class="col-sm-8">
                <input class="form-control" id="factory" name="factory" th:field="*{factory}" type="text">
            </div>
        </div>
        <div class="form-group" hidden="hidden">
            <label class="col-sm-3 control-label">单位：</label>
            <div class="col-sm-8">
                <input class="form-control" id="unit" name="unit" th:field="*{unit}" type="text">
            </div>
        </div>
        <!--     <div class="form-group" hidden="hidden">
          <label class="col-sm-3 control-label">经手人：</label>
            <div class="col-sm-8" hidden="hidden">
                <select class="form-control select2-multiple" id="createBy" multiple name="createBy">
                    <option th:each="user:${users}" th:text="${user.loginName}" th:value="${user.loginName}"></option>
                </select>
            </div>
        </div>
-->
        <div class="form-group">
            <label class="col-sm-3 control-label">领用人：</label>
            <div class="col-sm-8">
                <select class="form-control select2-multiple" id="receiver" name="receiver">
                    <option th:each="user:${users}" th:text="${user.loginName}" th:value="${user.loginName}"></option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">库存(支)：</label>
            <div class="col-sm-8">
                <input class="form-control" id="stockAmout" name="stockAmout" readonly="readonly"
                       th:field="*{stockAmout}"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库数量：</label>
            <div class="col-sm-8">
                <input class="form-control" id="outputAmount" name="outputAmount" type="number" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">功能主治：</label>
            <div class="col-sm-8">
                <input class="form-control" id="mainFunction" name="mainFunction" th:field="*{mainFunction}"
                       type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea class="form-control" name="remark" rows="4" th:field="*{remark}" type="text"></textarea>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<th:block th:include="include :: select2-js"/>

<script type="text/javascript">
    var prefix = ctx + "system/ncDrugsLogs";
    $("#form-ncDrugsLog-add").validate({
        rules: {
            inputAmount: {
                required: true,
                digits: true
            }

        },
        messages: {
            inputAmount: "入库数必须为正整数",
        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-ncDrugsLog-add').serialize());
        }
    }
</script>
</body>
</html>
